package com.chuangke.admin.dao.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chuangke.admin.entity.SysUser;
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser>{
	
	@Select("SELECT name, id,status,is_inherit_role,nick_name, hr_id,email,mobile,dept_id,job_type,post_id FROM sys_user where EXISTS (select 1 from sys_user_role where sys_user.id=sys_user_role.user_id and role_id=#{roleId}) ")
	List<SysUser> findUsersByRoleId(@Param("roleId") String roleId);
	
}